﻿using MarriageFertility.Helpers;
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.ComponentInterfaces;
using TaleWorlds.CampaignSystem.Party;

namespace MarriageFertility.Models;

public class MfPartySizeLimitModel:PartySizeLimitModel
{  
    private readonly PartySizeLimitModel _previousModel;
    
    public MfPartySizeLimitModel(PartySizeLimitModel previousModel)
    {
        _previousModel = previousModel;
    }
    
    public override ExplainedNumber GetPartyMemberSizeLimit(PartyBase party, bool includeDescriptions = false)
    { 
        if (MobileParty.MainParty.Party == party) Helper.FixPlayerMobileParty();
        return _previousModel.GetPartyMemberSizeLimit(party, includeDescriptions); 
    }
    
    public override ExplainedNumber GetPartyPrisonerSizeLimit(PartyBase party, bool includeDescriptions = false)
    {
        return _previousModel.GetPartyPrisonerSizeLimit(party, includeDescriptions);
    }

    public override int GetTierPartySizeEffect(int tier)
    {
        return _previousModel.GetTierPartySizeEffect(tier);
    }

    public override int GetAssumedPartySizeForLordParty(Hero leaderHero, IFaction partyMapFaction, Clan actualClan)
    {
        return _previousModel.GetAssumedPartySizeForLordParty(leaderHero, partyMapFaction, actualClan);
    }
}